package com.keymozy.util;

import javax.servlet.http.Cookie;

public class CookieUtil {
    public static Cookie getCookie(Cookie[] cookies, String key){
        if (cookies == null || cookies.length==0 || "".equals(key) || key == null || cookies.length==0)
            return null;
        for (Cookie cookie : cookies) {
            if (key.equals(cookie.getName()))
                return cookie;
        }
        return null;
    }
}
